﻿using System;
using System.Buffers;
using System.Buffers.Text;
using Xunit;

using Unity.String.Text;

namespace Unity.String.Tests.Text
{
    public class Utf8FormatHelperTest
    {
        [Fact]
        public void FormatToTest()
        {
            IBufferWriter<byte> bufferWriter = new ArrayBufferWriter<byte>();
            long argValue = 2;
            int width = 2;
            //ReadOnlySpan<char> format = new ReadOnlySpan<char>("{0} }}".ToCharArray());
            StandardFormat format = new StandardFormat('G');
            string argName = "0";
            Utf8FormatHelper.FormatTo(ref bufferWriter, argValue, width, format, argName);

            int negativeWidth = -2;
            Utf8FormatHelper.FormatTo(ref bufferWriter, argValue, negativeWidth, format, argName);

            int longWidth = 2048;
            Utf8FormatHelper.FormatTo(ref bufferWriter, argValue, longWidth, format, argName);
            
            int negativeLongWidth = -2048;
            Utf8FormatHelper.FormatTo(ref bufferWriter, argValue, negativeLongWidth, format, argName);

            string stringArgValue = "StringArgValue";
            Utf8FormatHelper.FormatTo(ref bufferWriter, stringArgValue, longWidth, format, argName);
            
            
        }
        
    }
}